package com.itmg.analyze.jp.bean;

import com.itmg.analyze.jp.model.KakakuSearchParamModel;
import com.itmg.util.Constants;
import com.itmg.vo.SearchParameterVO;
/**
 *  获得检索的关键字,排列种类
 * 
 * @author xuehaipeng
 * @version 1.0
 * */

public class KakakuParaBean {

	public KakakuParaBean() {
	}
	
	public static KakakuSearchParamModel getKakakuSearchParamModel(SearchParameterVO searchParameterVO) throws Exception
	{
		KakakuSearchParamModel kakakuSearchParamModel = new KakakuSearchParamModel();
		String keyword = searchParameterVO.getKeyword();
		kakakuSearchParamModel.setKeyword(keyword);
		if(searchParameterVO.getSort() != null && searchParameterVO.getSort().equals(Constants.SORT_PRICE_DOWN_TO_UP))
		{
			//kakakuSearchParamModel.setSortOrder("pricerank");
		}
		if(searchParameterVO.getSort() != null && searchParameterVO.getSort().equals(Constants.SORT_PRICE_UP_TO_DOWN))
		{
			//kakakuSearchParamModel.setSortOrder("-pricerank");
		}
		if(searchParameterVO.getSort() != null && searchParameterVO.getSort().equals(Constants.SORT_UPDATE_TIME_NEW_TO_OLD))
		{
			kakakuSearchParamModel.setSortOrder("daterank");
		}
		if(searchParameterVO.getSort() != null && searchParameterVO.getSort().equals(Constants.SORT_PV_RANK_UP_TO_DOWN))
		{
			kakakuSearchParamModel.setSortOrder("popularityrank");
		}
		return kakakuSearchParamModel;
	}
}
